package Demo02;

/**
 * @ClassName Test
 * @Description TODO
 * @Author 李明忠
 * @Date 2025/5/5 11:45
 * @Version 1.0
 */
interface IA{
    void func();
}
class Animal{
    void Test(){
        System.out.println("Animal test()");
    }
}
class OutClass{
    int age = 10;
    public class InnerClass{
        void fun(){
            System.out.println(age);
        }
    }
}
public class Test {
    public static void main(String[] args) {
        OutClass outClass = new OutClass();
        OutClass.InnerClass innerClass = outClass.new InnerClass();
        innerClass.fun();
        Animal animal = new Animal(){
            @Override
            void Test(){
                System.out.println();
            }
        };
       new Animal(){
            @Override
            void Test(){
                System.out.println();
            }
        };

       IA ia = new IA(){
           @Override
           public void func() {
               System.out.println("匿名内部类！！！实现了");
           }
       };
       ia.func();
        new IA(){
            @Override
            public void func() {

            }
        };
    }
}
